#include <format>
#include <iostream>

#include "utils.h"


// 前向声明所有示例函数
void basic_usage_example();
void polymorphism_example();
void formatting_example();
void streaming_example();
void advanced_features_example();

int main()
{
    std::cout << std::format("{:*^60}\n", " Microsoft Proxy Library Demo ");

    try
    {
        std::cout << std::format("\n{:-^50}\n", " Basic Usage Example ");
        basic_usage_example();

        std::cout << std::format("\n{:-^50}\n", " Polymorphism Example ");
        polymorphism_example();

        std::cout << std::format("\n{:-^50}\n", " Formatting Example ");
        formatting_example();

        std::cout << std::format("\n{:-^50}\n", " Streaming Example ");
        streaming_example();

        std::cout << std::format("\n{:-^50}\n", " Advanced Features Example ");
        advanced_features_example();
    }
    catch (const std::exception& e)
    {
        std::cerr << "Error: " << e.what() << std::endl;
        return 1;
    }

    std::cout << std::format("\n{:*^60}\n", " Demo Completed Successfully! ");
    return 0;
}